<template>
  <svg
      :class="['svg-icon', $attrs.class]"
      :style="{
      width: size + 'px',
      height: size + 'px',
      color: color
    }"
      aria-hidden="true"
  >
    <use :xlink:href="'#icon-' + name" :fill="color" />
  </svg>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'SvgIcon',
  props: {
    name: {
      type: String,
      required: true,
    },
    color: {
      type: String,
      default: '',
    },
    size: {
      type: [Number, String],
      default: 14,
    },
  }
});
</script>

<style scope lang="scss">
@import "./src/styles/variable.scss";
.svg-icon {
  fill: currentColor;
  color: $color-primary-base;
  vertical-align: middle;
}
</style>
